package com.wc.blue_bridge_history.Java14B.C_数组分割;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/11 10:02
 * @description https://www.lanqiao.cn/paper/3872/problem/3535/
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 1010;
    static int[] a = new int[N];
    static int t, n;
    // b[0] 表示偶数数量, b[1] 表示奇数数量
    static int[] b = new int[2];
    static int P = 1000000007;
    // f[i][j] 表示在i个里面选j个的方案数
    static int[][] f = new int[N][N];

    public static void main(String[] args) {
        init();
        t = sc.nextInt();
        while (t-- > 0) {
            n = sc.nextInt();
            for (int i = 1; i <= n; i++) {
                a[i] = sc.nextInt();
                b[a[i] & 1]++;
            }
            if (b[1] % 2 != 0) out.println(0);
            else {
                // 选偶数，选偶数的种类是
                long l = 0;
                for (int i = 0; i <= b[0]; i++) {
                    l = (l + f[b[0]][i]) % P;
                }
                long r = 0;
                for (int i = 0; i <= b[1]; i += 2) {
                    r = (r + f[b[1]][i]) % P;
                }

                long res = l * r % P;
                out.println(res);
            }
            b[0] = b[1] = 0;
        }
        out.flush();
    }

    static void init() {
        for (int i = 0; i < N; i++) {
            for (int j = 0; j <= i; j++) {
                if (j == 0) f[i][j] = 1;
                else f[i][j] = (f[i - 1][j - 1] + f[i - 1][j]) % P;
            }
        }
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}